package Demo3;

public class Main12 {
    public static void main(String[] args) throws InterruptedException {
        Thread t=new Thread(()->{
            for (int i = 0; i <3 ; i++) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        System.out.println(t.isAlive());//这个结果一定是false，此时还没创建线程
        t.start();
        while(true){
            Thread.sleep(1000);
            System.out.println(t.isAlive());//3秒钟后打印false
        }
    }
}
